import { createRouter, createWebHashHistory } from "vue-router";
const router = createRouter({
    history: createWebHashHistory(),
   routes: [
  // 路由重定向
  { path: '/', redirect: '/login' },
  { path: '/login', component: () => import('./components/Login.vue') },
  {
    path: '/home', component: () => import('./components/Home.vue'),
    redirect: '/home/users',
    children: [
      { path: 'users', component: () => import('./components/subcomponents/Users.vue') },
      { path: 'rights', component: () => import('./components/subcomponents/Rights.vue') },
      { path: 'goods', component: () => import('./components/subcomponents/Goods.vue') },
      { path: 'orders', component: () => import('./components/subcomponents/Orders.vue') },
      { path: 'settings', component: () => import('./components/subcomponents/Settings.vue') },
    ]
  },
]
})
export default router